package com.lnj.community;

import jakarta.annotation.PostConstruct;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.ui.Model;
import org.springframework.web.servlet.DispatcherServlet;

@SpringBootApplication
@MapperScan("com.lnj.community.mapper")
@EnableAsync //开启异步任务支持
@EnableScheduling //开启定时任务支持
public class CommunityApplication {
    @PostConstruct //在容器初始化完成后执行该方法
    public void init(){
        // 解决netty启动冲突问题
        // see Netty4Utils.setAvailableProcessors()
        System.setProperty("es.set.netty.runtime.available.processors", "false");
    }
    public static void main(String[] args) {
        SpringApplication.run(CommunityApplication.class, args);
    }

}
